<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');


class Show extends CI_Controller {

	function __construct()
	{
		parent::__construct();
	}

	public function index()
	{
		$this->load->helper('date');
		echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">';
		//var_dump($this->session->all_userdata());
		//var_dump($this->session->all_userdata());
		//var_dump(standard_date("Y-m-d H:i:s", now())); 
		
		if($this->session->userdata('username')!=null){			
			$this->load->helper('url');
			$this->load->helper('date');
			$this->load->model('user_m');
			$this->load->model('event_log_m');
			$result=$this->user_m->user_SelectByUserName($this->session->userdata('username'));

			$data=array(
			'id'=>$result[0]->id,
			'username'=>$result[0]->username,
			'password'=>$this->session->userdata('password'),
			'email'=>$result[0]->email,
			'tel'=>$result[0]->tel,
			'address'=>$result[0]->address,
			'time'=>$result[0]->time,
			'ip'=>$this->session->userdata('ip_address'),
			'browser'=>$this->session->userdata('user_agent'),
			'acttime'=>$result[0]->acttime
			);
			echo '服务器当前时间:'.unix_to_human(now(), TRUE,'PRC').'<br/>';
			echo timezone_menu('UP8').'<br/>'; 
			$this->load->view('show',$data);
		}else{
			echo ("<Script>
			window.alert(\"请先登录!\")
			</Script>");
			$this->load->view('login');
		}
	}

}
?>